package com.kerrykidz.filemanagement.dao.model;

import java.util.Calendar;
import java.util.Date;

import com.rdp.framework.core.model.MyBatisSuperModel;
import com.rdp.util.time.DateFormatUtil;

/**
 * 会员实体类
 * @author YJJ
 *
 */
public class VipUserEntity    extends MyBatisSuperModel{
	private String status;
	private String sex;
	private String name;
	private String memNo;
	private String pkMemId;
	private String age;
	private String country;
	private Date modiTime;
	private Date birthday;
	private String imagePath;
	private String isVip;
	private String ticketType;
	private String prdName;//购票种类
	private Date startDate;
	private Date endDate;
	private Date acceptDate;
	private String hisType;
	private Date inTime;
	private Date outTime;
	private String countryDesc;
	/**会员类型*/
	private  String memType;
	private  String nameOrTel;//姓名或者电话
	
	//黑名单，1=黑名单，其他非
	private String isBlack;
	public String getIsBlack() {
		return isBlack;
	}

	public void setIsBlack(String isBlack) {
		this.isBlack = isBlack;
	}

	public String getMemType() {
		return memType;
	}

	public void setMemType(String memType) {
		this.memType = memType;
	}

	public String getNameOrTel() {
		return nameOrTel;
	}

	public void setNameOrTel(String nameOrTel) {
		this.nameOrTel = nameOrTel;
	}

	public String getHisType() {
		return hisType;
	}

	public void setHisType(String hisType) {
		this.hisType = hisType;
	}

	public Date getAcceptDate() {
		return acceptDate;
	}

	public void setAcceptDate(Date acceptDate) {
		this.acceptDate = acceptDate;
	}
	//借用字段
	private Date payTime;
	
	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}
	
	public String getBirthdayPage() {
		if (this.birthday != null) {
			return DateFormatUtil.format(this.birthday, "yyyy.MM.dd");
		}
		return "";
	}

	public String getStartDatePage() {
		if (this.startDate != null) {
			return DateFormatUtil.format(this.startDate, "yyyy.MM.dd");
		}
		return "";
	}
	
	public String getEndDatePage() {
		if (this.endDate != null) {
			return DateFormatUtil.format(this.endDate, "yyyy.MM.dd");
		}
		return "";
	}
	
	public String getPayTimePage() {
		if (this.payTime != null) {
			return DateFormatUtil.format(this.payTime, "yyyy.MM.dd");
		}
		return "";
	}
	
	public String getAcceptDatePage() {
		if (this.acceptDate != null) {
			return DateFormatUtil.format(this.acceptDate, "yyyy.MM.dd");
		}
		return "";
	}
	
	public String getInTimePage() {
		if (this.inTime != null) {
			return DateFormatUtil.format(this.inTime, "yyyy.MM.dd");
		}
		return "";
	}
	
	public String getOutTimePage() {
		if (this.outTime != null) {
			return DateFormatUtil.format(this.outTime, "yyyy.MM.dd");
		}
		return "";
	}
	
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public String getSex() {
		return sex;
	}
	public void setSex(String sex) {
		this.sex = sex;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getMemNo() {
		return memNo;
	}
	public void setMemNo(String memNo) {
		this.memNo = memNo;
	}
	public String getPkMemId() {
		return pkMemId;
	}
	public void setPkMemId(String pkMemId) {
		this.pkMemId = pkMemId;
	}
	public String getAge() {
		if (birthday == null)
			return null;
		Calendar cal = Calendar.getInstance();

		int yearNow = cal.get(Calendar.YEAR);
		int monthNow = cal.get(Calendar.MONTH) + 1;
		int dayOfMonthNow = cal.get(Calendar.DAY_OF_MONTH);

		cal.setTime(birthday);
		int yearBirth = cal.get(Calendar.YEAR);
		int monthBirth = cal.get(Calendar.MONTH) + 1;
		int dayOfMonthBirth = cal.get(Calendar.DAY_OF_MONTH);

		int age = yearNow - yearBirth;

		if (monthNow <= monthBirth) {
			if (monthNow == monthBirth) {
				if (dayOfMonthNow < dayOfMonthBirth) {
					age--;
				}
			} else {
				// monthNow>monthBirth
				age--;
			}
		}

		this.age = age + "";
		return this.age;
	}
	public void setAge(String age) {
		this.age = age;
	}
	public String getCountry() {
		return country;
	}
	public void setCountry(String country) {
		this.country = country;
	}
	public Date getModiTime() {
		return modiTime;
	}
	public void setModiTime(Date modiTime) {
		this.modiTime = modiTime;
	}
	public String getImagePath() {
		return imagePath;
	}
	public void setImagePath(String imagePath) {
		this.imagePath = imagePath;
	}
	public String getIsVip() {
		return isVip;
	}
	public void setIsVip(String isVip) {
		this.isVip = isVip;
	}
	public String getTicketType() {
		return ticketType;
	}
	public void setTicketType(String ticketType) {
		this.ticketType = ticketType;
	}
	public String getPrdName() {
		return prdName;
	}
	public void setPrdName(String prdName) {
		this.prdName = prdName;
	}
	public Date getStartDate() {
		return startDate;
	}
	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}
	public Date getEndDate() {
		return endDate;
	}
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}
	public Date getPayTime() {
		return payTime;
	}
	public void setPayTime(Date payTime) {
		this.payTime = payTime;
	}
	public Date getInTime() {
		return inTime;
	}
	public void setInTime(Date inTime) {
		this.inTime = inTime;
	}
	public Date getOutTime() {
		return outTime;
	}
	public void setOutTime(Date outTime) {
		this.outTime = outTime;
	}
	public String getCountryDesc() {
		return countryDesc;
	}
	public void setCountryDesc(String countryDesc) {
		this.countryDesc = countryDesc;
	}
	
}
